<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<script>
		function show(){
			var id=document.getElementById("id").value;
			var reg=/^[0-9]+$/;
			var result= reg.test(id);
			if(!result){
				alert("请正确输入桌号！");
				document.getElementById("id").focus();
				id="";
				}else{
				window.location.href="<%=basePath%>"+ "Servlet/ROSServlet?req=show_order&table="+ id;
			}
		}
		function jump1(){
			window.location.href="<%=basePath%>"  + "main.jsp";
		}
		function checkout(){
			var id=document.getElementById("id").value;
			window.location.href="<%=basePath%>"+ "Servlet/ROSServlet?req=check_order&table="+ id;
		}
	</script>
	<head>
		<base href="<%=basePath%>">
		
		<title>订单功能</title>
		
	</head>
	
	<body>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="20" align="center">
					<div title="订单管理"><strong><font face="楷体_GB2312" size="6">订单管理</font><br></strong></div>
				</td>
			</tr>
			<tr>
				<td align="center"> 
					
					<br></td>
			</tr>
			<tr>
				<td align="center">
					
					桌号：<input type="text" id="id" value=""><input type="button" value="显示" onclick="javascript:show()"></td>
			</tr>
			
			<c:if test="${not empty table}">
			<c:forEach items="${table}"  var="list">
			<tr>
				<td>
					
					<c:out value="${list}"></c:out></td></tr>
			</c:forEach>
			</c:if>
			
			<tr>
				<td height="50" align="center">
					<input type="button" id='checkout' value='结账' align="middle" height="30" width="500px" onclick="javascript:checkout()" />
				</td>
			</tr>
			<tr>
				<td height="50" align="center">
					<input type="button" id='back' value='返回' align="middle" height="30" width="500px" onclick="javascript:jump1()" />
				</td>
			</tr>
		</table>
	</body>
</html>
